﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Util.Applications;

namespace IterationLife.Football.MTSports.Dtos.Sports {
    /// <summary>
    /// 运动员数据传输对象
    /// </summary>
    [DataContract]
    public class SportAthleteDto : DtoBase {
        /// <summary>
        /// 合作方运动员Id
        /// </summary>
        [Required(ErrorMessage = "合作方运动员Id不能为空")]
        [StringLength( 200, ErrorMessage = "合作方运动员Id输入过长，不能超过200位" )]
        [Display( Name = "合作方运动员Id" )]
        [DataMember]
        public string PartnerAthleteId { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [StringLength(50, ErrorMessage = "姓名输入过长，不能超过50位")]
        [DataMember]
        [Display( Name = "姓名")]
        public string Name { get; set; }
        /// <summary>
        /// 身份证号
        /// </summary>
        [StringLength( 50, ErrorMessage = "身份证号输入过长，不能超过50位" )]
        [Display( Name = "身份证号" )]
        [DataMember]
        public string IdCard { get; set; }
        
        /// <summary>
        /// 国籍
        /// </summary>
        [StringLength( 20, ErrorMessage = "国籍输入过长，不能超过20位" )]
        [Display( Name = "国籍" )]
        [DataMember]
        public string Nationality { get; set; }
        
        /// <summary>
        /// 性别
        /// </summary>
        [Required(ErrorMessage = "性别不能为空")]
        [Display( Name = "性别" )]
        [DataMember]
        public int Sex { get; set; }
        
        /// <summary>
        /// 生日
        /// </summary>
        [Display( Name = "生日" )]
        [DataMember]
        public DateTime? Birthday { get; set; }
        
        /// <summary>
        /// 身高cm
        /// </summary>
        [Display( Name = "身高cm" )]
        [DataMember]
        public decimal? Stature { get; set; }
        
        /// <summary>
        /// 体重kg
        /// </summary>
        [Display( Name = "体重kg" )]
        [DataMember]
        public decimal? Weight { get; set; }
        
        /// <summary>
        /// 历史平均数据
        /// </summary>
        [Display( Name = "历史平均数据" )]
        [DataMember]
        public string HistoryAverageJsonData { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        [Display( Name = "创建时间" )]
        [DataMember]
        public DateTime? CreationTime { get; set; }
        
        /// <summary>
        /// 创建人
        /// </summary>
        [Display( Name = "创建人" )]
        [DataMember]
        public Guid? CreatorId { get; set; }
        
        /// <summary>
        /// 最后修改时间
        /// </summary>
        [Display( Name = "最后修改时间" )]
        [DataMember]
        public DateTime? LastModificationTime { get; set; }
        
        /// <summary>
        /// 最后修改人
        /// </summary>
        [Display( Name = "最后修改人" )]
        [DataMember]
        public Guid? LastModifierId { get; set; }
        
        /// <summary>
        /// 是否删除
        /// </summary>
        [Required(ErrorMessage = "是否删除不能为空")]
        [Display( Name = "是否删除" )]
        [DataMember]
        public bool IsDeleted { get; set; }
        
        /// <summary>
        /// 版本号
        /// </summary>
        [Display( Name = "版本号" )]
        [DataMember]
        public Byte[] Version { get; set; }
        
        /// <summary>
        /// 输出运动员状态
        /// </summary>
        public override string ToString() {
            return this.ToEntity().ToString();
        }
    }
}
